home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / plotting / contour / contour.lha / Contour / time.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-28  |  543 b   |  30 lines

  1. #include <time.h>
  2. #include <sys/types.h>
  3. #include <sys/timeb.h>
  4. #include "plot.h"
  5.  
  6. /* get the local time */
  7. get_localtime(newtime)
  8. char newtime[];
  9. {
  10.    char      *ctime();
  11.    time_t    time();
  12.  
  13.    int       i;
  14.    time_t    timeofday;
  15.    char      *loctime;
  16.  
  17.    /* get the local time */
  18.    timeofday = time((time_t*)0);
  19.    loctime   = ctime(&timeofday);
  20.  
  21.    /* loctime has a '\n' in it, so delete that character */
  22.    i=0;
  23.    while ((loctime[i] != '\n') && (i<MAXCHAR)) {
  24.       newtime[i] = loctime[i];
  25.       i++;
  26.    }
  27.    newtime[i] = '\0';
  28. }
  29.  
  30.